package com.lzx.tease.controller.web;

import com.lzx.common.utils.R;
import com.lzx.tease.entity.SecondComments;
import com.lzx.tease.service.SecondCommentsService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 程序员星星
 * @date 2022/12/22
 * @Description
 */
@RestController
@RequestMapping("/tease/secondComments/web")
public class WebSecondCommentsController {
    @Resource
    private SecondCommentsService secondCommentsService;

    //获取一级和二级评论
    @GetMapping("/getFirstAndSecondComments")
    public R getFirstAndSecondComments() {
        return secondCommentsService.getFirstAndSecondComments();
    }

    //保存二级评论
    @PostMapping("/saveSecondComments")
    public R saveSecondComments(@RequestBody SecondComments secondComments) {
        return secondCommentsService.saveSecondComments(secondComments);
    }
}
